import impl.service.AudioServer;
import impl.service.MusicServer;
import impl.service.UploadServer;

import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    public static void main(String[] args) {
        ExecutorService threadPool = Executors.newFixedThreadPool(3);
        threadPool.execute(() -> {
            try {
                MusicServer musicServer = new MusicServer(8003);
                musicServer.start();
            } catch (IOException e) {
                e.printStackTrace();
            }
        });

        threadPool.execute(() -> {
            try {
                AudioServer audioServer = new AudioServer(8004);
                audioServer.start();
            } catch (IOException e) {
                e.printStackTrace();
            }
        });

        threadPool.execute(() -> {
            try {
                UploadServer uploadServer = new UploadServer(8005);
                uploadServer.start();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

        });

        threadPool.shutdown(); // 关闭线程池
    }
}
